package com.bwie.controller;

import com.bwie.pojo.User;
import com.bwie.service.UserService;
import com.bwie.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user/index")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * 登录
     * @param user
     * @return
     */
    @ApiOperation("登录")
    @PostMapping("login")
    public R login(@RequestBody User user){
        return userService.login(user);
    }

}
